#ifndef __CRITTER_H__
#define __CRITTER_H__

#include <windows.h>
#include "cPath.h"
#include "cNPC.h"

class cScene;

class cPC
{
	private:
		int x, y;			//Position in total map
		int cx, cy;			//Cell position in total map

		cPath path;
		int animSeq;		//Sequence animation control
		int animDelay;		//Animation delay

		bool goingToAttack;	//Order to attack established (moving for attack)
		bool attack;		//Begin attack
		int attackSeq;		//Shooter sequence animation control
		int attackDelay;	//Shooter animation delay

		// Check whether the preselected cell is walkable or not. Iterate counterclowise to select a walkable one in case it is not
		void SelectAttackCell(cScene *scene, int destcx, int destcy, int npcCx, int npcCy);

	public:
		cPC(void);
		~cPC(void);

		void GoToCell(cScene *scene, int destcx, int destcy);
		void GoToNPC(cScene *scene, cNPC *npc);
		void BlockCells(cScene *scene);
		void UnBlockCells(cScene *scene);
		void Move(cScene *scene);

		void SetPosition(int posx, int posy);
		void GetPosition(int *posx, int *posy);
		void SetCell(int cellx, int celly);
		void GetCell(int *cellx, int *celly);

		void GetRect(RECT *rc, int *posx, int *posy, cScene *scene);
		void GetRectRadar(RECT *rc, int *posx, int *posy);
		void GetRectLife(RECT *rc, int *posx, int *posy, cScene *scene);
		void GetRectAttack(RECT *rc, int *posx, int *posy, cScene *scene);

		bool IsGoingToAttack();
		bool IsAttacking();
};

#endif